<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="../lib/angular.min.js"></script>
	<script src="../lib/ocCore/dist/ocCore.js"></script>
<!--	<script src="../dist/ocDialog.min.js"></script>-->

	<script src="../src/global.js"></script>

	<script src="../src/directive/ocDialog.js"></script>
	<script src="../src/directive/ocAlert.js"></script>
	<script src="../src/directive/ocAddress.js"></script>
	<script src="../src/directive/ocDataList.js"></script>
	<script src="../src/directive/ocFile.js"></script>
	<script src="../src/directive/ocGrid.js"></script>
	<script src="../src/directive/ocListMenu.js"></script>
	<script src="../src/directive/ocTabs.js"></script>

	<script src="../src/prototype/dialogManager.js"></script>
	<script src="../src/prototype/dialogFactory.js"></script>
	<script src="../src/prototype/dialogInstance.js"></script>

	<script src="../src/service/ocDialog.js"></script>

	<script src="../src/directive/switch/ocDialogClose.js"></script>
	<script src="../src/directive/switch/ocDialogOpen.js"></script>
	<script src="../src/directive/switch/ocDialogSizeMode.js"></script>
	<script src="../src/directive/switch/ocAlertOpen.js"></script>
	<script src="../src/directive/switch/ocFileOpen.js"></script>

<!-- Style sheets -->
	<link rel="stylesheet/less" href="../resources/less/style.less">
	<script src="../node_modules/less/dist/less.js"></script>

<!--	<link rel="stylesheet" href="../dist/style.css">-->


	<script>
	var app = angular.module("test", ['oc-dialog']);
	app.config(function (ocDialogProvider) {
		ocDialogProvider.config("ROUTE_PATH", "./dialog/");
		ocDialogProvider.config("BASE_Z_INDEX", 500);
	});
	app.controller('E', function($scope, $element, ocDialog) {
		var DI = ocDialog.queryDI($element);

		$scope.menu =  [
		{
			title: '文件(F)',
			menu: [
				{
					title: '新建(N)',
					attr: 'ng-mousedown="fuck()"'
				},
				{
					title: '打开(O)',
					attr: 'oc-dialog-open="ccc"'
				},
				null,
				{
					title: '保存(S)'
				},
				{
					title: '另存为'
				},
				null,
				{
					title: '关闭探针(X)'
				}
			]
		},
		{
			title: '编辑(E)',
			menu: [
				{
					title: '撤销'
				},
				{
					title: '重复'
				},
				null,
				{
					title: '删除'
				},
				{
					title: '全部删除',
					attr: 'oc-alert-open="clearCase"'
				},
				null,
				{
					title: '向上插入',
					sub: [
						{
							title: '动作'
						},
						{
							title: '等待'
						},
						{
							title: '断言'
						}
					]
				},
				{
					title: '追加',
					sub: [
						{
							title: '动作'
						},
						{
							title: '等待'
						},
						{
							title: '断言'
						}
					]
				}
			]
		}];


		DI.$scope(function (scope) {
			scope.buttons = [
				{
					className: 'api',
					fn: function () {
						$scope.fuck3 = "fuck api";
					}
				},
				{
					className: 'simulation',
					fn: function () {
						$scope.fuck3 = "fuck simulation";
					}
				},
				{
					className: 'monkey',
					fn: function () {
						$scope.fuck3 = "fuck monkey";
					}
				},
			];
		});



		$scope.ocDialog = {
			title: "太牛逼了",
			isFull: false
		};

		$scope.fuck = function () {
			DI.$scope(function (scope) {
				$scope.fuck3 = scope.title;
				scope.title = 'shit!';
				if (scope.dataSet) {
					scope.dataSet.title = '儿子不服，改标题了';
				}
			});
		};

		$scope.hehe = function () {
			console.log($scope.ocDialog);
		};

		$scope.ccc= {
			name: "ccc",
			closed: function () {
				console.log('child has been closed!');
				$scope.fuck3 = "儿子死了";
			},
			dataSet: $scope.ocDialog
		}

		$scope.test2 = {
			title: "试试警告",
			message: "fsdfsfsdfsfsdfs",
			callFn: function () {
				console.log('警告结束');
			}
		}
	});
	app.controller('A', function($scope, ocDialog) {
		$scope.ccc= {
			name: "ccc"
		}

		$scope.ddd = function () {
			ocDialog.file({
				action: "打开",
				title: "待测数据对象"
			});
		}
	});
	</script>
</head>
<body ng-app="test" ng-controller="A">
	<a oc-dialog-open="ccc">fdsfsfdf</a>
	<a oc-file-open="ccc">打开文件</a>
	<a ng-click="ddd()">服务打开文件</a>

<!--
	<div ng-controller="A">
		{{ett.ocDialog.title}}
	</div>
-->
</body>
</html>
